package com.ag.bean;

import javax.persistence.AttributeOverride;
import javax.persistence.AttributeOverrides;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * TbRolePermission entity.
 * 
 * @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "TB_ROLE_PERMISSION", schema = "dbo", catalog = "AGDB")
public class TbRolePermission implements java.io.Serializable {

	// Fields

	private TbRolePermissionId id;
	private TbRole tbRole;
	private TbPermission tbPermission;
	private String a;
	private String b;
	private String c;

	// Constructors

	/** default constructor */
	public TbRolePermission() {
	}

	/** minimal constructor */
	public TbRolePermission(TbRolePermissionId id, TbRole tbRole,
			TbPermission tbPermission) {
		this.id = id;
		this.tbRole = tbRole;
		this.tbPermission = tbPermission;
	}

	/** full constructor */
	public TbRolePermission(TbRolePermissionId id, TbRole tbRole,
			TbPermission tbPermission, String a, String b, String c) {
		this.id = id;
		this.tbRole = tbRole;
		this.tbPermission = tbPermission;
		this.a = a;
		this.b = b;
		this.c = c;
	}

	// Property accessors
	@EmbeddedId
	@AttributeOverrides( {
			@AttributeOverride(name = "RId", column = @Column(name = "R_ID", nullable = false, length = 4)),
			@AttributeOverride(name = "PId", column = @Column(name = "P_ID", nullable = false, length = 4)) })
	public TbRolePermissionId getId() {
		return this.id;
	}

	public void setId(TbRolePermissionId id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "R_ID", nullable = false, insertable = false, updatable = false)
	public TbRole getTbRole() {
		return this.tbRole;
	}

	public void setTbRole(TbRole tbRole) {
		this.tbRole = tbRole;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "P_ID", nullable = false, insertable = false, updatable = false)
	public TbPermission getTbPermission() {
		return this.tbPermission;
	}

	public void setTbPermission(TbPermission tbPermission) {
		this.tbPermission = tbPermission;
	}

	@Column(name = "A", length = 60)
	public String getA() {
		return this.a;
	}

	public void setA(String a) {
		this.a = a;
	}

	@Column(name = "B", length = 60)
	public String getB() {
		return this.b;
	}

	public void setB(String b) {
		this.b = b;
	}

	@Column(name = "C", length = 60)
	public String getC() {
		return this.c;
	}

	public void setC(String c) {
		this.c = c;
	}

}